# 创建
truple1 = (1, 3.1, True, 'hello')
truple2 = 1, 5, 'a', 'python'
print(truple1)
print(type(truple1))
print(truple2)
print(type(truple2))

truple3 = ()

truple4 = (5)
truple5 = (5,)
print(truple4)
print(type(truple4))
print(truple5)
print(type(truple5))

# 元组访问
tup1 = ('Google', 'python', 1997, 2000)
print(tup1[0])
print(tup1[1])
print(tup1[2])

tup = ('Google', 'sina', 'Taobao', 'Wiki', 'Weibo', 'Weixin')
print(tup[1:3])
print(tup[1:])

print(tup1 + tup)

# 删除
tup2 = ('Google', 'python', 1997, 2000)

print(tup2)
del  tup2
# print(tup2)

#
tup = ('Google', 'sina', 'Taobao', 'Wiki', 'Weibo','Weixin')
print(tup.count(5))
print(tup.index('Wiki'))


